//
//  UIImage+CreateUseExt.m
//  jrw
//
//  Created by cabinzhao on 7/20/17.
//  Copyright © 2017 武汉玖信普惠金融信息服务有限公司. All rights reserved.
//

#import "UIImage+CreateUseExt.h"

@implementation UIImage (CreateUseExt)

+ (UIImage *)createImageByColor:(UIColor *)color size:(CGSize) size {
    
    CGRect rect = CGRectMake(0, 0, size.width, size.height);
    UIGraphicsBeginImageContext(rect.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetFillColorWithColor(context, [color CGColor]);
    CGContextFillRect(context, rect);
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return img;
}

@end
